package com.baidu.mpks.statistic.meta;

import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Objects;

@Data
@NoArgsConstructor
public class DateCount implements Serializable {
    private String date;
    private long count;

    public DateCount(String date, long count) {
        this.date = date;
        this.count = count;
    }

    public String getDate() {
        return date;
    }

    public void setDate(String date) {
        this.date = date;
    }

    public long getCount() {
        return count;
    }

    public void setCount(long count) {
        this.count = count;
    }

    @Override
    public String toString() {
        return "{" +
                "\"date\":\"" + date + "\"," +
                "\"count:\"" + count + "\"" +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (!(o instanceof DateCount)) {
            return false;
        }
        DateCount dateCount = (DateCount) o;
        return date.equals(dateCount.date);
    }

    @Override
    public int hashCode() {
        return Objects.hash(date);
    }
}
